package de.hochschuletrier.bachelor.antfarm.entity;
import org.newdawn.slick.GameContainer;

import de.hochschuletrier.bachelor.antfarm.settings.Settings;
import de.hochschuletrier.bachelor.antfarm.util.AssetManager;
import de.hochschuletrier.bachelor.antfarm.util.assets.AssetImage;
import de.hochschuletrier.bachelor.antfarm.world.World;

public class Pheromon extends Entity {
	private int timeToLive;

	public Pheromon(int x, int y) {
		super("Pheromon", x, y, AssetManager.getInstance().getImage(AssetImage.pheromon));
		timeToLive = Settings.getPheromonTimeToLive();
	}

	public int getTimeToLive() {
		return timeToLive;
	}

	@Override
	public void update(GameContainer gc, int delta) {
		timeToLive--;
		if (timeToLive <= 0) {
			World.getInstance().removeEntity(this);
		}
	}
}
